package com.sh.exception;

/**
 * @Auther: 世豪学java
 * @Date: 2023/12/13 - 12 - 13 - 18:19
 * @Decsription: com.sh.exception
 * @version: 1.0
 */

import com.sh.util.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * 全局异常统一处理
 */
@RestControllerAdvice("top.psjj.wy")
@Slf4j
public class GlobalException {
    @ExceptionHandler(Exception.class)
    public Object handlerException(Exception e){
        log.error("系统异常"+e.getMessage());
        return Result.error(500,e.getMessage());
    }
}
